﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using POSSystem.DAL;

namespace POSSystem.BLL
{
    public class Problems :_Problems
    {
        public static Problems GetAllActiveProblems()
        {
            try
            {
                Problems p = new Problems();
                p.Where.Deleted.Value = false;
                p.Where.BranchID.Value = Branches.CurrentBranchID;
                p.Query.Load();
                return p;
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("Problems.cs", "GetAllActiveProblems", ex.StackTrace);
                throw ex;
            }
        }

        public static Problems GetAllActiveProblems(int branchID)
        {
            try
            {
                Problems p = new Problems();
                p.Where.Deleted.Value = false;
                p.Where.BranchID.Value = branchID;
                p.Query.Load();
                return p;
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("Problems.cs", "GetAllActiveProblems", ex.StackTrace);
                throw ex;
            }
        }
    }
}
